<?php
function smarty_insert_getregisterbutton($param, &$smarty) {
	$q=urlencode($param['q']);
    switch($param['style']) {
		case 'blue':
			$registerImg='images/blue/jw_flash_x.gif';
		break;
		case 'gray':
			$registerImg='images/gray/jw_flash_x.gif';
		break;
		default:
			$registerImg='images/jw_flash_x.gif';
		break;
	}
	if ($_SESSION['union_username']=='') {
		$string="<div class=\"jw_flashbox jw_allbox\"><img src=\"".$registerImg."\" border=\"0\" usemap=\"#Map\"/>
<map name=\"Map\" id=\"Map\"><area shape=\"rect\" coords=\"72,172,211,219\" href=\"register.php\" /></map></div>";
	} else {
		$backurl=urlencode('http://'.$param['backurl']);
		$serverlist = @file_get_contents("https://passport.9wee.com/payment/tools/serverlist.php");
	    $serverlist = unserialize($serverlist);
		$yx_list=$serverlist['103'];
		foreach ($yx_list as $key=>$value) {
			$yx_string.="<dd><a href=\"http://$key/passport.php?act=login&q=$q&from=$backurl\">$value</a></dd>";
		}
		$sg_list=$serverlist['102'];
		foreach ($sg_list as $key=>$value) {
			$sg_string.="<dd><a href=\"http://$key.sg.9wee.com/index.php?q=$q&backurl=".$backurl."\">$value</a></dd>";
		}
		$string="<div class=\"jw_dlh\">
	  		<div class=\"jw_dhl_title\"></div>
			<div class=\"jw_dhl_con\">
				<div class=\"jw_dhl_sg\">
					<dl>
						<dt>武林三国</dt>
					".$sg_string."
					</dl>
					<dl>
					<dd>
					<a style=\"color:#000000; text-decoration:underline;\" href='javascript:;' onclick=\"server_select('open');document.getElementById('gametype').src='game/sanguo/xuanqu.php?q=".$q."&url=".$_SERVER['HTTP_HOST']."'\">更多服务器</a>
					</dd>
					</dl>
				</div>
				<div class=\"jw_dhl_sg\">
					<dl>
						<dt>武林英雄</dt>
						".$yx_string."  
					</dl>
					<dl>
					<dd>
					<a style=\"color:#000000; text-decoration:underline;\" href='javascript:;' onclick=\"server_select('open');document.getElementById('gametype').src='game/hero/xuanqu.php?q=".$q."&url=".$_SERVER['HTTP_HOST']."'\">更多服务器</a>
					</dd>
					</dl>
				</div>
				<div class=\"jw_dhl_sg\">
					<dl>
						<dt>武林足球经理II</dt>
						<dd><a href=\"http://s1.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">一苇渡江</a></dd>
						<dd><a href=\"http://s2.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">血海飘香</a></dd>
						<dd><a href=\"http://s3.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">魔动九天</dd>
					    <dd><a href=\"http://s4.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">巫月仙舞</dd>
					</dl>
					<dl>
					    <dd><a href=\"http://s5.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">龙隐九州</a></dd>
						<dd><a href=\"http://s6.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">影月重楼</a></dd>
					    <dd><a href=\"http://s7.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">血战八方</a></dd>
						<dd><a href=\"http://s8.zq2.9wee.com/?q=".$q."&backurl=".$backurl."\">七星聚义</a></dd>
					</dl>
				</div>
				<div class=\"jw_dhl_sg\">
					<dl>
						<dt>武林足球经理</dt>
						<dd><a href=\"http://my.zq.9wee.com/?q=".$q."&backurl=".$backurl."\">武林足球经理一区</a></dd>
					</dl>
				</div>
			</div>
	  </div>";
					
	}
	return $string;
 }
?>
